<template>
  <div>
    <div class="p1">home页面</div>
    <a-button class="save btn" @click="signout">退出登录</a-button>
    <a-button class="save btn" @click="theme">进入主题页面</a-button>
    <a-button class="save btn" @click="flow">工作流</a-button>
    <a-button class="save btn" @click="testRouter2">动态路由list页面</a-button>
    <a-button class="save btn" @click="onLayout">布局页面</a-button>
    <a-button class="save btn" @click="xtmoduleShowFun">echarts图</a-button>
    <a-button class="save btn" @click="click1">报表底部弹窗</a-button>
    <a-button class="save btn" @click="xtmoduleShowFunIp">IP弹窗</a-button>
    <a-button class="save btn" @click="xtmoduleShowFunPdk">PDK弹窗</a-button>

    <!-- 报表组件  IP/PDK申请表单   方便展示   随时删除-->
    <div style="display: flex">
      <!-- <XTModule v-if="xtmoduleShow" /> -->
      <!-- <XTModuleBIColumnar v-if="xtmoduleShow" /> -->
      <XTModuleFormEDAItem v-if="xtmoduleShow" />
      <XTModuleTableSuperComputerItem v-if="xtmoduleShow" />
      <XTModuleFormIP ref="refTestComponent" />
    </div>
    <XTModuleBIEdit ref="click1Edit" />
    <XTModuleFormPDK ref="refTestComponentPdk" />
    <XTModuleViewEditor />
    <!-- 报表组件  IP/PDK申请表单   方便展示   随时删除-->
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router"
import { nextTick, onMounted, reactive, shallowRef } from "vue"
import { userStore } from "@/store/userStore"
// 报表组件  IP/PDK申请表单   方便展示   随时删除
// import XTModule from "@/components/Business/XTModuleBI/XTModuleBI.vue"
// import XTModuleBIColumnar from "@/components/Business/XTModuleBI/XTModuleBIColumnar.vue"
import XTModuleFormIP from "@/components/Business/XTModuleForm/XTModuleFormIP.vue"
import XTModuleFormPDK from "@/components/Business/XTModuleForm/XTModuleFormPDK.vue"
import XTModuleFormEDAItem from "@/components/Business/XTModuleFormEDA/XTModuleFormEDAItem.vue"
import XTModuleTableSuperComputerItem from "@/components/Business/XTModuleTableSuperComputer/XTModuleTableSuperComputerItem.vue"
import XTModuleBIEdit from "@/components/Business/XTModuleBI/XTModuleBIEdit.vue"
import XTModuleViewEditor from "@/components/Business/XTModuleViewEditor/XTModuleViewEditor.vue"

// 报表组件  IP/PDK申请表单   方便展示   随时删除
const router = useRouter()
const theme = () => {
  router.push("/theme")
}

const flow = () => {
  router.push("/XTModuleWorkflowEditor")
}

const testRouter2 = () => {
  // console.log("routes ...", router.getRoutes());
  router.push("/list")
}

const signout = () => {
  // 删除数据， 进入login页面
  userStore().setRoutesMap([])
  userStore().userInfo.token = ""
  router.push("/login")
}

/*
自定义组件展示
*/
const xtmoduleShow = ref(false)
const xtmoduleShowFun = () => {
  xtmoduleShow.value = true
}
const refTestComponent = ref()
const xtmoduleShowFunIp = () => {
  refTestComponent.value.visibleHide()
}
const refTestComponentPdk = ref()
const xtmoduleShowFunPdk = () => {
  refTestComponentPdk.value.visibleHide()
}

const onLayout = () => {
  router.push("/layout")
}
const click1Edit = ref()
const click1 = () => {
  click1Edit.value.setOpen()
}

// onMounted(() => {})
</script>

<style scoped lang="less">
.p1 {
  height: 30px;
  font-size: 30px;
  margin-bottom: 50px;
}
</style>
